package com.memento.entity;

import com.memento.SerializableDTO;
import com.memento.backup.Memento;

public class Role extends SerializableDTO {

    private Integer blood;  // 血量

    private Integer mana;  // 法力

    public Role(Integer blood, Integer mana) {
        this.blood = blood;
        this.mana = mana;
    }

    public Integer getBlood() {
        return blood;
    }

    public void setBlood(Integer blood) {
        this.blood = blood;
    }

    public Integer getMana() {
        return mana;
    }

    public void setMana(Integer mana) {
        this.mana = mana;
    }

    public Memento createMemento() {
        return new Memento(blood, mana);
    }

    public void restoreMemento(Memento memento) {
        this.blood = memento.getBlood();
        this.mana = memento.getMana();
    }

    @Override
    public String toString() {
        return "Role{" +
                "blood=" + blood +
                ", mana=" + mana +
                '}';
    }
}
